package com.note.chh.notebook.Adapter;

import android.graphics.Color;
import android.view.View;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.note.chh.notebook.R;

/**
 * Created by caihuahui on 2018/3/12.
 */

public class MusicLyricAdapter extends BaseQuickAdapter<String,BaseViewHolder> {
    public MusicLyricAdapter(int layoutResId) {
        super(layoutResId);
    }

    @Override
    protected void convert(BaseViewHolder helper, String item) {
        if (!item.isEmpty()) {
            String[] split = item.split("\\|");
            String sLyric = split[0];
            String s = split[1];
            TextView mText_lyric = helper.getView(R.id.mText_lyric);
            if (s.equals("0")) {
                mText_lyric.setTextColor(mContext.getResources().getColor(R.color.white));
                mText_lyric.setTextSize(16);
            }else{
                mText_lyric.setTextColor(mContext.getResources().getColor(R.color.primrose_yellow));
                mText_lyric.setTextSize(21);
            }
            helper.setText(R.id.mText_lyric,sLyric);
        }else{
            helper.setText(R.id.mText_lyric,"");
        }

    }
}
